import axios from '@/utils/request';

/**
 * 一级分类
 * @param params 查询条件
 */
export async function wenshengPictureList(params) {
 
  const res = await axios.get('/figure.intelligence/wenshengPictureList', {
    params
  });
  if (res.data.code === 0) {
    return res.data.data;
  }
  return Promise.reject(new Error(res.data.message));
}

export async function replacement(params) {
 
  const res = await axios.get('/figure.intelligence/replacement', {
    params
  });
  if (res.data.code === 0) {
    return res.data.data;
  }
  return Promise.reject(new Error(res.data.message));
}

export async function oldImageRepair(params) {
 
  const res = await axios.get('/figure.intelligence/oldImageRepair', {
    params
  });
  if (res.data.code === 0) {
    return res.data.data;
  }
  return Promise.reject(new Error(res.data.message));
}
export async function faceTransplant(params) {
 
  const res = await axios.get('/figure.intelligence/faceTransplant', {
    params
  });
  if (res.data.code === 0) {
    return res.data.data;
  }
  return Promise.reject(new Error(res.data.message));
}

export async function changeHair(params) {
 
  const res = await axios.get('/figure.intelligence/changeHair', {
    params
  });
  if (res.data.code === 0) {
    return res.data.data;
  }
  return Promise.reject(new Error(res.data.message));
}

export async function highDefinition(params) {
 
  const res = await axios.get('/figure.intelligence/highDefinition', {
    params
  });
  if (res.data.code === 0) {
    return res.data.data;
  }
  return Promise.reject(new Error(res.data.message));
}



export async function separateAudio(params) {
 
  const res = await axios.get('/figure.intelligence/separateAudio', {
    params
  });
  if (res.data.code === 0) {
    return res.data.data;
  }
  return Promise.reject(new Error(res.data.message));
}




export async function list(params) {
 
  const res = await axios.get('/figure.intelligence/intelligenceList', {
    params
  });
  if (res.data.code === 0) {
    return res.data.data;
  }
  return Promise.reject(new Error(res.data.message));
}


/**
 * 添加
 * @param data 机构信息
 */
export async function add(data) {
  const res = await axios.post('/figure.intelligence/intelligenceAdd', data);
  if (res.data.code === 0) {
    return res.data.message;
  }
  return Promise.reject(new Error(res.data.message));
}


/**
 * 修改
 * @param data 机构信息
 */
export async function update(data) {
  const res = await axios.post('/figure.intelligence/intelligenceEdit', data);
  if (res.data.code === 0) {
    return res.data.message;
  }
  return Promise.reject(new Error(res.data.message));
}


/**
 * 添加
 * @param data 机构信息
 */
export async function addClass(data) {
  const res = await axios.post('/figure.intelligence/addClass', data);
  if (res.data.code === 0) {
    return res.data.message;
  }
  return Promise.reject(new Error(res.data.message));
}


/**
 * 修改
 * @param data 机构信息
 */
export async function updateClass(data) {
  const res = await axios.post('/figure.intelligence/updateClass', data);
  if (res.data.code === 0) {
    return res.data.message;
  }
  return Promise.reject(new Error(res.data.message));
}

/**
 * 排序
 * @param params nid oid 两个排序的id
 */
 export async function sortChange(params) {
  const res = await axios.post('/figure.intelligence/sortChange', {
    params
  });
  if (res.data.code === 0) {
    return res.data.data;
  }
  return Promise.reject(new Error(res.data.message));
}


/**
 * 删除
 * @param id id
 */
export async function remove(id) {
  const res = await axios.get('/figure.intelligence/delete?id=' + id);
  if (res.data.code === 0) {
    return res.data.message;
  }
  return Promise.reject(new Error(res.data.message));
}
export async function intelligenceLog(params) {
 
  const res = await axios.get('/figure.intelligence/intelligenceLog', {
    params
  });
  if (res.data.code === 0) {
    return res.data.data;
  }
  return Promise.reject(new Error(res.data.message));
}

export async function intelligenceClass(params) {
 
  const res = await axios.get('/figure.intelligence/intelligenceClass', {
    params
  });
  if (res.data.code === 0) {
    return res.data.data;
  }
  return Promise.reject(new Error(res.data.message));
}



/**
 * 排序
 * @param params nid oid 两个排序的id
 */
export async function modify(data) {
  const res = await axios.post('/figure.intelligence/modify', data);
  if (res.data.code === 0) {
    return res.data.message;
  }
  return Promise.reject(new Error(res.data.message));
}

export async function calsssortChange(params) {
  const res = await axios.post('/figure.intelligence/calsssortChange', {
    params
  });
  if (res.data.code === 0) {
    return res.data.data;
  }
  return Promise.reject(new Error(res.data.message));
}


export async function calssmodify(data) {
  const res = await axios.post('/figure.intelligence/calssmodify', data);
  if (res.data.code === 0) {
    return res.data.message;
  }
  return Promise.reject(new Error(res.data.message));
}